import Vue from "vue";
import VueRouter from "vue-router";
const login = () => import("../views/login.vue");
const home = () => import("../views/home.vue");
const waveform = () => import("../views/waveform.vue");
const shot = () => import("../views/shot.vue");
const direct = () => import("../views/direct.vue");
Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    name: "login",
    component: login,
  },
  {
    path: "/home",
    name: "home",
    component: home,
    redirect: "/waveform",
    children: [
      { path: "/direct", component: direct },
      { path: "/waveform", component: waveform },
      { path: "/shot", component: shot },
    ],
  },
];
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
const router = new VueRouter({
  routes,
});

export default router;
